function [c, flag] = read_single_c30(datapath, senno)

%datapath: the directory where the data files are stored
%senno: the sensor number, also the file name

%Occupancy: measure the percentage of time a detector is active due to
%           the presence of vehicle during a time T
%           value outside the range 0~100 can be considered as invalid
%ref: http://www.d.umn.edu/~tkwon/TMCdata/Traffic.html
filename = sprintf('%s\\%s.c30',datapath, senno);
fid = fopen(filename, 'r');
if fid == -1
    c=zeros(2880,1);
    flag = 0;
    warning('%s.v30 may not exist\n', senno)

else
    c = fread(fid, 2880, 'bit16', 'ieee-be');
    c= c./18.0;
    fclose(fid);
    flag = 1;
end